<template>
	<view class="profile">
		<template v-if="isLogin">
			<u-navbar title-color="#000" :isBack="false" back-icon-color="#ffffff" :is-fixed="true" height="60" title="个人中心"
			 :back-text-style="{color: '#fff'}">
				<view class="navbar-right" slot="right">
					<view class="message-box right-item" @click="geSetting">
						<u-icon name="setting" size="40"></u-icon>
					</view>
				</view>
			</u-navbar>
			<view class="m-t20 user-icon">
				<u-avatar :size="100" :src="userInfo.userUrl"></u-avatar>
				<view class="user-name">{{userInfo.userName}}</view>
			</view>
			<view class="notice m-t20">
				<view class="title">通知</view>
				<view class="item">
					<view class="left">
						<image class="icon" src="../../static/icon/橙色收藏.png"></image>
						<view class="text">收藏</view>
					</view>
					<view class="right">
						<image class="icon" src="../../static/icon/跳转_1.png"></image>
					</view>
				</view>
				<view class="item">
					<view class="left">
						<image class="icon" src="../../static/icon/橙色评论.png"></image>
						<view class="text">评论</view>
					</view>
					<view class="right">
						<image class="icon" src="../../static/icon/跳转_1.png"></image>
					</view>
				</view>
				<view class="item">
					<view class="left">
						<image class="icon" src="../../static/icon/橙色点赞.png"></image>
						<view class="text">点赞</view>
					</view>
					<view class="right">
						<image class="icon" src="../../static/icon/跳转_1.png"></image>
					</view>
				</view>
			</view>
			<view class="notice m-t20">
				<view class="title">启示</view>
				<view class="item">
					<view class="left">
						<image class="icon" src="../../static/icon/橙色启示.png"></image>
						<view class="text">我的启示</view>
					</view>
					<view class="right">
						<image class="icon" src="../../static/icon/跳转_1.png"></image>
					</view>
				</view>
				<view class="item">
					<view class="left">
						<image class="icon" src="../../static/icon/橙色领养.png"></image>
						<view class="text">我的领养</view>
					</view>
					<view class="right">
						<image class="icon" src="../../static/icon/跳转_1.png"></image>
					</view>
				</view>
			</view>
		</template>
		<template v-else>
			<view>
				<u-modal v-model="show_modal" @confirm="confirm" content="暂未登录,请先前往登录." :maskCloseAble="true"></u-modal>
			</view>
		</template>
		<view class="uni-b"></view>
		<tab-bar pagePath="/pages/profile/profile"></tab-bar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show_modal: false
			};
		},
		onShow() {
			if (!this.isLogin) {
				this.show_modal = true
			}
		},
		methods: {
			confirm() {
				this.$comm.navigateTo('/pages/login/login')
			},
			geSetting(){
				this.$comm.navigateTo('/pages/setting/setting')
			}
		}
	}
</script>

<style lang="scss">
	.notice {
		width: 100vw;
		padding: 20upx;
		background-color: #FFFFFF;

		.item {
			height: 100upx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.left {
				display: flex;
				align-items: center;

				.icon {
					width: 36upx;
					height: 36upx;
				}

				.text {
					margin-left: 10upx;
				}
			}

			.right {
				.icon {
					width: 30upx;
					height: 30upx;
				}
			}
		}
	}

	.navbar-right {
		margin-right: 24rpx;
		display: flex;
	}

	.right-item {
		margin: 0 12rpx;
		position: relative;
		display: flex;
	}

	.user-icon {
		background-color: #FFFFFF;
		height: 180upx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;

		.user-name {
			margin-top: 10upx;
		}
	}
</style>
